<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.10/vue.js"></script>
</head>
<body>
<div id="app">
    <input type="text" v-model="search"/>
    <ul>
        <li v-for="item in finallyPerson" :key="item.id">
            {{item.name}} -- {{item.age}}
        </li>
    </ul>
</div>
<script>
  const vm = new Vue({
    el:"#app",
    data(){
      return{
        search:"",
        person:[
            {id:"001",name:"王杰",age:31},
            {id:"002",name:"张杰",age:27},
            {id:"003",name:"王五",age:35},
            {id:"004",name:"周董",age:39},
            {id:"005",name:"周杰",age:33},
            {id:"006",name:"张学友",age:32},
        ],
        finallyPerson:[],
      }
    },
    watch:{
        search: {
          immediate:true,
          handler(){
              this.finallyPerson = this.person.filter(item=>{
                  return item.name.includes(this.search)
              })
          }
      }
    }
  })
</script>
</body>
</html>